library AilmentCountCommand initializer init requires LegacySystem

	private function AilmentCount takes nothing returns nothing
		local player p = GetTriggerPlayer()
		call DisplayTimedTextToPlayer( p, 0.0, 0.0, 20.0, " " )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "|cfff3ad00Ailment Log - 3rd Platoon, Echo Company|r" )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Hits Taken : " + I2S(udg_HitsTaken) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Oxalic Poisoning : " + I2S(udg_AilmentCount[1]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Hydrocyanic Poisoning : " + I2S(udg_AilmentCount[2]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Open Wounds : " + I2S(udg_AilmentCount[3]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Fractures : " + I2S(udg_AilmentCount[4]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Parasite : " + I2S(udg_AilmentCount[5]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Veratrum Poisoning : " + I2S(udg_AilmentCount[6]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Short Circuit : " + I2S(udg_AilmentCount[7]) )
		call DisplayTimedTextToPlayer( p, 0, 0, 20.0, "Infection : " + I2S(udg_AilmentCount[8]) )
		call DisplayTimedTextToPlayer( p, 0.0, 0.0, 20.0, " " )
	endfunction

	//===========================================================================
	private function init takes nothing returns nothing
		local trigger t = CreateTrigger()
		local integer i = 0
		
		loop
			exitwhen i > 11
			call TriggerRegisterPlayerChatEvent(t, Player(i), "-ac", true)
			set i = i + 1
		endloop

		call TriggerAddAction(t,function AilmentCount)
	endfunction

endlibrary

